package cn.grpc.service.pdfprint;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.28.1)",
    comments = "Source: printer_provider.proto")
public final class DdfPrintProviderGrpc {

  private DdfPrintProviderGrpc() {}

  public static final String SERVICE_NAME = "DdfPrintProvider";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<cn.grpc.service.pdfprint.PrinterProvider.RequestParam,
      cn.grpc.service.pdfprint.PrinterProvider.Message> getGoPtPdfMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "goPtPdf",
      requestType = cn.grpc.service.pdfprint.PrinterProvider.RequestParam.class,
      responseType = cn.grpc.service.pdfprint.PrinterProvider.Message.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<cn.grpc.service.pdfprint.PrinterProvider.RequestParam,
      cn.grpc.service.pdfprint.PrinterProvider.Message> getGoPtPdfMethod() {
    io.grpc.MethodDescriptor<cn.grpc.service.pdfprint.PrinterProvider.RequestParam, cn.grpc.service.pdfprint.PrinterProvider.Message> getGoPtPdfMethod;
    if ((getGoPtPdfMethod = DdfPrintProviderGrpc.getGoPtPdfMethod) == null) {
      synchronized (DdfPrintProviderGrpc.class) {
        if ((getGoPtPdfMethod = DdfPrintProviderGrpc.getGoPtPdfMethod) == null) {
          DdfPrintProviderGrpc.getGoPtPdfMethod = getGoPtPdfMethod =
              io.grpc.MethodDescriptor.<cn.grpc.service.pdfprint.PrinterProvider.RequestParam, cn.grpc.service.pdfprint.PrinterProvider.Message>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "goPtPdf"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  cn.grpc.service.pdfprint.PrinterProvider.RequestParam.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  cn.grpc.service.pdfprint.PrinterProvider.Message.getDefaultInstance()))
              .setSchemaDescriptor(new DdfPrintProviderMethodDescriptorSupplier("goPtPdf"))
              .build();
        }
      }
    }
    return getGoPtPdfMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static DdfPrintProviderStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<DdfPrintProviderStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<DdfPrintProviderStub>() {
        @java.lang.Override
        public DdfPrintProviderStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new DdfPrintProviderStub(channel, callOptions);
        }
      };
    return DdfPrintProviderStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static DdfPrintProviderBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<DdfPrintProviderBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<DdfPrintProviderBlockingStub>() {
        @java.lang.Override
        public DdfPrintProviderBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new DdfPrintProviderBlockingStub(channel, callOptions);
        }
      };
    return DdfPrintProviderBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static DdfPrintProviderFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<DdfPrintProviderFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<DdfPrintProviderFutureStub>() {
        @java.lang.Override
        public DdfPrintProviderFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new DdfPrintProviderFutureStub(channel, callOptions);
        }
      };
    return DdfPrintProviderFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class DdfPrintProviderImplBase implements io.grpc.BindableService {

    /**
     */
    public void goPtPdf(cn.grpc.service.pdfprint.PrinterProvider.RequestParam request,
        io.grpc.stub.StreamObserver<cn.grpc.service.pdfprint.PrinterProvider.Message> responseObserver) {
      asyncUnimplementedUnaryCall(getGoPtPdfMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getGoPtPdfMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                cn.grpc.service.pdfprint.PrinterProvider.RequestParam,
                cn.grpc.service.pdfprint.PrinterProvider.Message>(
                  this, METHODID_GO_PT_PDF)))
          .build();
    }
  }

  /**
   */
  public static final class DdfPrintProviderStub extends io.grpc.stub.AbstractAsyncStub<DdfPrintProviderStub> {
    private DdfPrintProviderStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected DdfPrintProviderStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new DdfPrintProviderStub(channel, callOptions);
    }

    /**
     */
    public void goPtPdf(cn.grpc.service.pdfprint.PrinterProvider.RequestParam request,
        io.grpc.stub.StreamObserver<cn.grpc.service.pdfprint.PrinterProvider.Message> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getGoPtPdfMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class DdfPrintProviderBlockingStub extends io.grpc.stub.AbstractBlockingStub<DdfPrintProviderBlockingStub> {
    private DdfPrintProviderBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected DdfPrintProviderBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new DdfPrintProviderBlockingStub(channel, callOptions);
    }

    /**
     */
    public cn.grpc.service.pdfprint.PrinterProvider.Message goPtPdf(cn.grpc.service.pdfprint.PrinterProvider.RequestParam request) {
      return blockingUnaryCall(
          getChannel(), getGoPtPdfMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class DdfPrintProviderFutureStub extends io.grpc.stub.AbstractFutureStub<DdfPrintProviderFutureStub> {
    private DdfPrintProviderFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected DdfPrintProviderFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new DdfPrintProviderFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<cn.grpc.service.pdfprint.PrinterProvider.Message> goPtPdf(
        cn.grpc.service.pdfprint.PrinterProvider.RequestParam request) {
      return futureUnaryCall(
          getChannel().newCall(getGoPtPdfMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_GO_PT_PDF = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final DdfPrintProviderImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(DdfPrintProviderImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GO_PT_PDF:
          serviceImpl.goPtPdf((cn.grpc.service.pdfprint.PrinterProvider.RequestParam) request,
              (io.grpc.stub.StreamObserver<cn.grpc.service.pdfprint.PrinterProvider.Message>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class DdfPrintProviderBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    DdfPrintProviderBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return cn.grpc.service.pdfprint.PrinterProvider.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("DdfPrintProvider");
    }
  }

  private static final class DdfPrintProviderFileDescriptorSupplier
      extends DdfPrintProviderBaseDescriptorSupplier {
    DdfPrintProviderFileDescriptorSupplier() {}
  }

  private static final class DdfPrintProviderMethodDescriptorSupplier
      extends DdfPrintProviderBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    DdfPrintProviderMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (DdfPrintProviderGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new DdfPrintProviderFileDescriptorSupplier())
              .addMethod(getGoPtPdfMethod())
              .build();
        }
      }
    }
    return result;
  }
}
